﻿CREATE PROCEDURE [acms].[User_GetByEmailActivationCodeAndSiteId]
	@Code varchar(10), 
	@SiteId int
AS
	SELECT a.*
	FROM [acms].[User_View] a 
		inner join  [acms].[EmailActivationCode_View] b on a.Id = b.UserId
	Where isNull(a.SiteId, @SiteId) = @SiteId and b.Code = @Code
RETURN 0